
layui.use(['layer', 'element','tree'], function () { //独立版的layer无需执行这一句
    var $ = layui.jquery, layer = layui.layer, element = layui.element, tree = layui.tree; //独立版的layer无需执行这一句

    var loginUrls = jsRoutes.controllers.UsersController.login();
    var upwdUrls = jsRoutes.controllers.UsersController.updatePWD();
    var dingTalkAuth = jsRoutes.controllers.UsersController.dingTalkAuth();
    //触发事件
    $('#layerOpen .lay-btn').on('click', function () {
        var othis = $(this), method = othis.data('method');
        active[method] ? active[method].call(this, othis) : '';
    });
    //渲染
        var inst1 = tree.render({
          elem: '#treetest1'  //绑定元素
          ,isJump:false
          ,accordion:true
          ,data: [{
            title: '所有商品' //一级菜单
            ,children: [{
              title: '列表一' //二级菜单
              ,children: [{
                title: '高新区' //三级菜单
                //…… //以此类推，可无限层级
                 }]
              },
              {
              title: '列表二' //二级菜单
              ,children: [{
                title: '高新区' //三级菜单
                //…… //以此类推，可无限层级
              }]
            },{
             title: '列表三' //一级菜单
             ,click:function(obj){console.log("列表三");window.top.location.href = "/home";}

          }]
          },{
            title: '陕西' //一级菜单
            ,children: [{
              title: '西安' //二级菜单
            }]
          }]
        });

});
